package com.rui.service.impl;

import com.rui.dao.ManagerDao;
import com.rui.entity.Manager;
import com.rui.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * Created by Administrator on 2017/4/14.
 */
@Service
public class ManagerServiceImpl implements ManagerService{

    @Autowired
    private ManagerDao managerDao;


    public void add(Manager manager) {
        managerDao.add(manager);
    }

    public void delete(Integer id) {
        managerDao.delete(id);
    }

    public Manager findOne(Integer id) {
        return managerDao.findOne(id);
    }

    public void update(Manager manager) {
        managerDao.update(manager);
    }

    public List<Manager> findManagers(String userName, Integer pageSize, Integer pageIndex) {
        return managerDao.findManagers(userName,pageSize, pageIndex);
    }

    public Integer findTotalPage(String userName, Integer pageSize) {
        return managerDao.findTotalPage(userName, pageSize);
    }

    public Manager findByUserName(String userName) {
        return managerDao.findByUserName(userName);
    }

    public List<Manager> findManagers(String userName, Integer id) {
        return managerDao.findManagers(userName, id);
    }
}
